<template>
	<view>
		<u-navbar :title="TabTitle?TabTitle:'鹏城快享'" :background="BgColor" :title-size="26" :title-color="'#000'"
			:back-icon-color="'#000'" :is-back="false" back-icon-size="32"
			:custom-back="toBack" :border-bottom="false"> 
			<view v-show="isNeedBack" class="left_item u-m-l-20 u-flex">
				<u-icon @click="handleGoHome" name="arrow-left" color="#000000" size="32" v-if="isCustom&&isReturn == 0" />
				<u-icon @click="toBack" name="arrow-left" color="#000000" size="32" v-else />
				<view class="text_line" />
				<u-icon class="u-m-l-24" @click="handleGoHome" name="home-fill" color="#000000" size="32" />
			</view>
		</u-navbar>
	</view>
</template>

<script>
	export default{
		props:['TabTitle','isNeedBack','isCustom',"isReturn"],
		data(){
			return{
				BgColor:{background:'#f8f8f8'},
			}
		},
		methods: {
			toBack() {
				uni.navigateBack({
					delta: 1
				})
			},
			handleGoHome(){
				uni.switchTab({
					url:"/pages/index/index",
					// success: function(e) {
					// 	var page = getCurrentPages().pop();
					// 	if (page == undefined || page == null) return;
					// 	page.onShow();
					// }
				})
			}
		},
	}
</script>


<style lang="scss" scoped>
	.left_item {
		border: solid 1rpx #d9d9d9;
		padding: 15rpx 30rpx 15rpx 20rpx;
		border-radius: 20px;
		background-color: #fff;
		
		.text_line {
			border-left: solid 1rpx #d9d9d9;
			height: 36rpx;
			margin-left: 16rpx;
		}
	}
</style>